\subsection{Data structures}

\subsubsection{\auto}
The main data structure is obviously the \auto , since it is the core of this project.

\begin{figure}[h]
\centering
\includegraphics[scale=0.45]{img/FSA}
\caption{The \auto\ data structure}
\label{fig:data_structure}
\end{figure}

The figure \ref{fig:data_structure} below shows the data structure we chose to use to manipulate \autos . \mk\\

An \auto\ basicaly consist of a nama which is a simple \tech{String}, and a set of \st s, a \tech{HashSet} more precisely.\sk

In the same way a \st\ is composed of some attributes and a set of \tr s, representing the ones it is origin of.\mk 

The attributes being :\sk
\begin{itemize}
\item idState : It's identifier.
\item stateName : It's name.
\item initial : Whether it is an initial \st\ or not.
\item final : Whether it is a final \st\ or not.\mk\\
\end{itemize}

As for the transition, we have :\sk
\begin{itemize}
\item idTransition : It's identifier.
\item label : It's label.
\item targetState : A reference to the \st\ which is its target.\mk\\
\end{itemize}

At first we thought about using lists rather than a sets, but after discussing it we our tutor we came to the conclusion that the use of sets was more consistent with the definition of an \fsa . 
Moreover the use of sets provided also some other advantages such as the fact that you can't find twice the same element. 
In order to use this propriety we only had the override the \tech{equals} method in our classes.\bk

\subsubsection{Animation}

The goal of the project was to be able to animate \algos\ on \autos\, so now we have seen how an \auto\ is built let's move to the \ani .\bk
\begin{figure}[h]
\centering
\includegraphics[scale=0.45]{img/animation}
\caption{The \ani\ data structure}
\label{fig:animation}
\end{figure}

For the \ani\ rather than display it while running the \algo\ and having to move back and forth inside the \algo we have decided to execute it completly once and forall and store each major step into a list.
This way we can easiy and directly access to the result of the execution, and as for the display of the \ani\ we we only have to browse the resulting list.\mk\\

Hence the structure of the \ani\ presented on the figure \ref{fig:animation} below. An \ani\ simlply consists of two \tech{ArrayList}, one for the \autos\ representing each step and another for the associated commentaries.\bk

\subsection{Algorithm}

One of the project's requirement was that it shouldn't be too complicated to add other \algo s. \mk

\begin{figure}[h]
\centering
\includegraphics[scale=0.45]{img/animation}
\caption{The \Algo\ data structure}
\label{fig:algo}
\end{figure}

For this reason, as can be seen in figure \ref{fig:algo} we chose to create an \Algo\ abstract class. 
Class that any \algo\ to be implemented must inherit of \Algo , this way we know that this \algo\ will be called using the calculus method and that this method will give us an \ani in return. 
The nbAutomata is used to know whether the \algo\ requires one or two \autos . 
Then by knowing this we also which one of the two \tech{calculus} methods to use.